import com.dfbz.utils.JDBCUtil;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

public class test {

    public static void main(String[] args) throws Exception {
        Connection connection = JDBCUtil.getConnection();
        PreparedStatement statement = connection.prepareStatement("select * from student");
        ResultSet resultSet = statement.executeQuery();
        while(resultSet.next()){
            String id = resultSet.getString("id");
            String name = resultSet.getString("name");
            String phone = resultSet.getString("phone");
            String address = resultSet.getString("address");
            System.out.println("id "+id+" name "+name+" phone "+phone+" address "+address);
        }
        JDBCUtil.close(resultSet,statement,connection);
    }
}
